package com.example.backend.api.controller;


import com.example.backend.api.common.Result;
import com.example.backend.api.service.impl.ProjectServiceImpl;
import com.example.backend.api.service.impl.Project_userServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xwyzsn
 * @since 2023-03-07
 */
@RestController
@RequestMapping("/api/project_user")
@CrossOrigin(origins = "*",maxAge = 3600)
public class Project_userController {

    @Autowired
    private Project_userServiceImpl projectUserService;
    @GetMapping("info")
    public Result getInfo() throws Exception {
        return projectUserService.getInfo();
    }
    @GetMapping("project")
    public Result getProjectUser(@RequestParam (value = "project_id") String projectId){
        return projectUserService.getProjectUser(projectId);
    }

    @GetMapping("user")
    public Result getUser(@RequestParam(value = "user_id") String userId){
        return projectUserService.getUser(userId);
    }

    @GetMapping("getuserdetail")
    public Result getUserDetail(@RequestParam(value = "project_id") String userId) throws Exception {
        return projectUserService.getUserDetail(userId);
    }

    @GetMapping("getperson")
    public Result getPerson(@RequestParam(value = "user_id") Integer user_id){
        return projectUserService.getPerson(user_id);
    }



}
